package com.it.plic;

import java.io.IOException;
import java.io.InputStream;
import java.net.ServerSocket;
import java.net.Socket;

/**
 * @author げっしょく
 * @date 2021/8/8
 */
public class Demo4_1 {
    public static void main(String[] args) throws IOException {
        ServerSocket s = new ServerSocket(10000);
        System.out.println("我正在看着你看着你");
        Socket accept = s.accept();
        System.out.println("目不转睛");
        InputStream ips = accept.getInputStream();
        int i ;
        byte[] b = new byte[1024];
        while ((i = ips.read(b)) != -1){
            System.out.print(new String(b, 0, i));
        }
        s.close();
        accept.close();
        ips.close();
    }
}
